<template lang="pug">
  div
    s-table(
      ref="table"
      :column="tableObj.column"
      :filterProps="{items: filterItems}"
      :queryFn="tableObj.getList"
      :tableProps="{selection: true}"
      rowKey="rowIds"
      @selectionChange="rows => selectedRows = rows"
      title="预警列表"
      )
      .table-operator(slot="table-operator")
        el-button(size="small" type="success") 批量提交稽核线索
      template(slot="taskWay" slot-scope="text, scope") {{dictFilter(text, 'SCEN_TASK_WAY')}}
      template(slot="taskWay" slot-scope="text, scope") {{dictFilter(text, 'SCEN_TASK_WAY')}}
</template>
<script>
import { STable } from '@/components'
import { warnasocbizList } from '@/api/warning'

export default {
  components: {
    STable
  },
  data () {
    return {
      tableObj: {
        column:
        [
          {
            prop: 'dicId',
            label: '预警名称',
            align: 'center'
          },
          {
            prop: 'dicId',
            label: '设备编号',
            align: 'center'
          },
          {
            prop: 'dicId',
            label: '级别',
            align: 'center'
          },
          {
            prop: 'dicId',
            label: '预警对象',
            align: 'center'
          },
          {
            prop: 'dicId',
            label: '医疗机构',
            align: 'center'
          },
          {
            prop: 'dicId',
            align: 'center',
            label: '疑似违规操作描述'
          },
          {
            prop: 'dicId',
            label: '预警时间',
            align: 'center'
          },
          {
            prop: 'dicId',
            label: '处理状态',
            align: 'center'
          }
        ],
        getList: warnasocbizList
      },
      selectedRows: []
    }
  },
  computed: {
    filterItems () {
      return [
        {
          key: 'keyword',
          label: '预警名称'
        },
        {
          key: 'devType',
          label: '预警类型',
          type: 'selectdict',
          dictKey: 'SECN_WARN_FLAG'
        },
        {
          key: 'medinsId',
          label: '级别',
          type: 'selectdict'
        },
        {
          key: 'medinsId',
          label: '处理状态',
          type: 'selectdict'
        },
        {
          key: 'medinsId',
          label: '预警对象',
          type: 'selectdict'
        },
        {
          key: 'medinsId',
          label: '医疗机构',
          type: 'selectdict'
        },
        {
          key: 'time',
          label: '选择时间',
          type: 'daterange'
        }
      ]
    }
  },
  created () {
  },
  methods: {
    // 刷新表格
    refreshTable (flag = false) {
      this.$refs.table.refresh(flag)
    }
  }
}
</script>
